class UpdateManyTables < ActiveRecord::Migration
  def self.up
    say "add column on user table"
    remove_column :users, :name
    add_column :users, "firstname", :string, :null => false
    add_column :users, "lastname", :string
    add_column :users, "email", :string, :null => false
    add_column :users, "adress", :string
    add_column :users, "cp", :string
    add_column :users, "city", :string
    
    say "add new permission to role"
    add_column :roles, "view_admin", :boolean, :null => false, :default => 0
    Role.webadmin.update_attributes! :view_admin => 1
    Role.superadmin.update_attributes! :view_admin => 1
  end

  def self.down
  end
end
